﻿import com.dinmax.flash.utilities.movieclip.*

class DummyFactory {
	
	public static function getNextDummy(root:MovieClip):MovieClip {
		if(!root) var root:MovieClip = _root;
		if(!root.dummyContainer) root.createEmptyMovieClip("dummyContainer", root.getNextHighestDepth());
		
		var rootClip:MovieClip = root.dummyContainer;
		
		var nDummyNumber:Number = 0;
		while(rootClip["mcDummy"+nDummyNumber]){
			nDummyNumber++;
		}
		
		return rootClip.createEmptyMovieClip("mcDummy"+nDummyNumber, rootClip.getNextHighestDepth());
	}
			
}